import request from '@/utils-shop/request'

// api地址
const api = {
  list: 'appointment/list',
  detail: 'appointment/detail',
  pass: 'appointment/pass',
  refuse: 'appointment/refuse',
  finish: 'appointment/finish',
  timeList: 'appointment/timeList',
  timeDetail: 'appointment/timeDetail',
  timeAdd: 'appointment/timeAdd',
  timeEdit: 'appointment/timeEdit',
  timeRemove: 'appointment/timeRemove',
}

// 预约列表
export const list = param => {
  return request.get(api.list, param)
}

// 预约详情
export const detail = appointmentId => {
  return request.get(api.detail, { appointmentId })
}

// 通过预约
export const pass = appointmentId => {
  return request.get(api.pass, { appointmentId })
}

// 拒绝预约
export const refuse = appointmentId => {
  return request.get(api.refuse, { appointmentId })
}

// 完成预约
export const finish = appointmentId => {
  return request.get(api.finish, { appointmentId })
}

// 员工列表
export const timeList = param => {
  return request.get(api.timeList, param)
}

// 员工详情
export const timeDetail = id => {
  return request.get(api.timeDetail, { id })
}

// 添加员工
export const timeAdd = (data) => {
  return request.post(api.timeAdd, { form:data })
}

// 编辑员工
export const timeEdit = (id, data) => {
  return request.post(api.timeEdit, { id, form:data })
}

// 删除员工
export const timeRemove = id => {
  return request.post(api.timeRemove, { id })
}